/**
 * 
 */
package com.et114.core.common;

import java.util.HashMap;
import java.util.Map;

import org.springframework.util.Assert;

/**
 * @author guanhw
 *
 */
public class EctableConverts {
	private Map proConverts =  new HashMap() ;
	private Map dics = new HashMap() ;   //
	

	public void setProConvert ( String key , String value ) {
		proConverts.put ( key , value ) ;
	}
	
	public String getProConvertValue( String key ) {
		return ( String ) proConverts.get ( key ) ; 
	}
	
	public boolean proConvertsContainsKey( String key ) { 
		return proConverts.containsKey ( key ) ;
	}
	
	public String[] proConvertsKeys(  ) {
		String[] keys = new String[ proConverts.size ( ) ] ; 
		proConverts.keySet ( ).toArray ( keys ) ; 
		return keys ; 
	}
	
	public void setDic(  EctableDic dic ) {
		String pn = dic.getProName ( ) ; 
		Assert.state( !( pn == null || "".equals( pn.trim() ) ) , "dic name is NULL !" );
		dics.put ( pn , dic ) ;
	}
	
	public EctableDic getDic( String proname ) {
		return ( EctableDic )dics.get ( proname ) ;
	}  
	
	public boolean dicsContainsKey( String proname ) {
		return dics.containsKey ( proname ) ;
	}
	
	public String[] dicsKeys(  ) {
		String[] keys = new String[ dics.size ( ) ] ; 
		dics.keySet ( ).toArray ( keys ) ; 
		return keys ; 
	}	
}
